package ygw.study.designPatterns.abstractfactory;

/**
 * <p>
 * 创建一个工厂创造器/生成器类，通过传递形状或颜色信息来获取工厂。
 * </p>
 * <p>
 * Copyright:2021.All rights reserved.
 * </p>
 * <p>
 * Company:Zsoft
 * </p>
 * <p>
 * CreateDate:2021-05-20 20:50
 * </p>
 *
 * @author YuGongWen
 * @history Mender:YuGongWen；Date:2021-05-20 20:50；
 */
public class FactoryProducer {
    
    public static AbstractFactory getFactory(String choice) {
        
        if (choice.equalsIgnoreCase("SHAPE")) {
            
            return new ShapeFactory();
            
        } else if (choice.equalsIgnoreCase("COLOR")) {
            
            return new ColorFactory();
            
        }
        return null;
    }
}